#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

typedef long long ll;
typedef double db;
typedef vector < int > vec;
typedef pair < int , int > pii;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 510;
const int S = 2e5 + 10;

int a[N], ans[S], K, n, s;
bool v[N];

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
	n = in, K = in; rep(i, 1, n) a[i] = in, s += a[i];
	rep(i, 1, s) {
		int P = (s - i) / K + 1, Q = (s - i) % K + 1, cnt = 0, m = n + 10;
		rep(j, 1, n) if(a[j] > P) return puts("-1"), 0; else if(a[j] == P) cnt++;
		if(cnt > Q) return puts("-1"), 0;
		rep(j, 1, n) v[j] = 0;
		rep(j, max(1, i - K + 1), i - 1) v[ans[j]] = true;
		if(cnt == Q) {
			rep(j, 1, n) if(!v[j] && a[j] == P) { m = j; break; }
			if(m > n) return puts("-1"), 0;
		} else {
			rep(j, 1, n) if(!v[j] && a[j]) { m = j; break; }
		}
		a[m]--; ans[i] = m;
	} rep(i, 1, s) printf("%d ", ans[i]);
	puts(""); return 0;
}
